package com.ls.controller;


import com.ls.base.BaseResult;
import com.ls.controller.model.channel.AddChannelModel;
import com.ls.controller.model.channel.QueryChannelModel;
import com.ls.controller.model.commService.AddCommServiceModel;
import com.ls.controller.model.commService.EditCommServiceModel;
import com.ls.controller.model.commService.QueryCommServiceModel;
import com.ls.entity.SysUser;
import com.ls.service.ICommChannelService;
import com.ls.service.ICommServiceService;
import com.ls.utils.login.CurrentUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.validation.Valid;

/**
 * <p>
 *  业务基础管理
 * </p>
 *
 * @author pengyu
 * @since 2019-12-05
 */
@Api(value = "业务基础管理相关接口", description = "业务基础管理相关接口")
@Controller
@RequestMapping("/commService")
public class CommServiceController {

    @Autowired
    ICommServiceService service;

    /**
     * 新增
     */
    @ApiOperation(value = "新增")
    @PostMapping(value = "add")
    @ResponseBody
    public BaseResult add(@Valid @RequestBody AddCommServiceModel model, @CurrentUser SysUser currentUser) {
        return service.add(model, currentUser);
    }

    /**
     * 修改
     */
    @ApiOperation(value = "修改")
    @PostMapping(value = "edit")
    @ResponseBody
    public BaseResult edit(@Valid @RequestBody EditCommServiceModel model, @CurrentUser SysUser currentUser) {
        return service.edit(model, currentUser);
    }

    /**
     * 查询
     */
    @ApiOperation(value = "查询分页列表")
    @GetMapping(value = "listByPage")
    @ResponseBody
    public BaseResult listByPage(QueryCommServiceModel model, @CurrentUser SysUser currentUser) {
        return service.listByPage(model, currentUser);
    }


}

